import styled from 'styled-components'

const arr = require('../../assets/img_arr.png')

export const Learn = styled.div`
.xxjd{
  background: #f2f2f2;
  line-height: .66rem;
  font-size: .28rem;
  color: #808080;
  padding: 0 .30rem;
  img{
    float: right;
    width: .15rem;
    margin-top: .20rem;
  }
}
.title{
  font-weight: bold;
  line-height: .78rem;
  font-size: .28rem;
  span{
    float: right;
    color: #c29c5d;
    font-weight: normal;
  }
}
.prev{
  background: #fff;
  padding: 0 .30rem .30rem;
  margin-bottom: .2rem;
  position: relative;
  img, video{
    width: 100%;
    border-radius: .10rem;
    max-height: 3rem;
  }
  .tm{
    opacity: 0
  }
  i{
    position: absolute;
    font-size: 1rem;
    left: 50%;
    top: 40%;
    margin: -.5rem 0 0 -.5rem;
    color: #c29c5d;
  }
  h2{
    font-weight: normal;
    font-size: .32rem;
    color: #333;
    margin: .2rem 0 .15rem;
  }
  p{
    font-size: .28rem;
    color: #808080;
    line-heigth: .40rem;
  }
  .time{
    font-size: .24rem;
    color: #808080;
    text-align: right;
    margin: .15rem 0;
    background: transparent url(${arr}) no-repeat right center;
    background-size: .15rem .30rem;
    padding-right: .2rem;
  }
}

.kc{
  // margin-top: .20rem;
  background: #fff;
  padding: 0 .30rem;
  li{
    overflow: hidden;
    padding-bottom: .3rem;
    img{
      float: left;
      width: 2.1rem;
      height: 1.3rem;
      border-radius: .05rem;
      margin-right: .30rem;
    }
    .hidden{
      overflow: hidden;
      h2{
        font-size: .32rem;
        line-height: .32rem;
        font-weight: normal;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        margin-bottom: .15rem;
      }
      p{
        font-size: .28rem;
        line-height: .40rem;
        font-weight: normal;
        text-overflow: ellipsis;
        display:-webkit-box; 
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2; 
        overflow: hidden;
        color: #808080;
      }
    }
  }
}
`

export const Head = styled.div`
  overflow: hidden;
  padding: .1rem 0 .2rem;
  text-align: center;
  background: #fff;
  h2{
    font-size: .3rem;
    color: #333;
    margin: .1rem 0;
  }
  p{
    font-size: .24rem;
    color: #333;
  }
`
export const TopicContent = styled.div`
  padding: .3rem;
  font-size: .24rem;
  color: #333;
  button{
    width: 100%;
    margin: .2rem 0;
    background: rgb(194, 156, 93);
    color: #fff;
    text-align: center;
    line-height: .5rem;
    height: .5rem;
    font-size: .24rem;
    border: 0;
  }
`


export const Topic = styled.div`
  margin-top: .20rem;
  background: #fff;
  overflow: hidden;
  .title{
    font-size: .30rem;
    line-height: .80rem;
    padding: 0 .3rem;
    color: #333;
    border-bottom: 0.01rem solid #e6e6e6;
    span{
      float: right;
    }
  }
  h4{
    font-size: .28rem;
    color: #333;
    margin-top: .2rem;
    padding: 0 .3rem;
    font-weight: normal;
  }
  ul{
    padding: .2rem .3rem;
  }
  li{
    line-height: .6rem;
    position: relative;
    padding-left: .36rem;
    &:after{
      content: '';
      position: absolute;
      left: 0;
      width: .25rem;
      top: .15rem;
      height: .25rem;
      border-radius: .05rem;
      border: 0.01rem solid #ccc;
    }
    &.atthis:after{
      border-color: #c29c5d;
    }
    &.atthis:before{
      content: '√';
      position: absolute;
      color: #c29c5d;
      left: 0;
      width: .25rem;
      text-align: center;
      top: 0;
      font-size: .20rem;
      // height: .1rem;
      border-radius: 50%;
    }
    &.error{
      color: #e52727;
    }
  }
  .btn{
    text-align: center;
    padding: .2rem 0 .3rem;
    button{
      background: #c29c5d;
      padding: .2rem .7rem;
      color: #fff;
      border-radius: .6rem;
      border: 0;
      margin: 0 .2rem;
      font-size: .24rem;
      &.next{
        border: 0.01rem solid #c29c5d;
        background: #fff;
        color: #c29c5d;
      }
    }
  }

  .da{
    font-size: .28rem;
    line-height: .48rem;
    padding: 0 .3rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
    span{
      color: #e52727;
    }
  }
`

export const Video = styled.div`
  height: 4rem;
  position: relative;
  video{
    width: 100%;
    height: 100%;
  }
  .tm{
    opacity: 0
  }
  .bg{
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    i{
      font-size: .8rem;
    }
    h3{
      font-size: .28rem;
      color: #fff;
      margin: .2rem 0;
      font-weight: normal;
    }
    button{
      width: 1.7rem;
      line-height: .40rem;
      height: .6rem;
      border: .01rem solid #fff;
      border-radius: .05rem;
      color: #fff;
      margin: 0 auto;
      font-size: .28rem;
      background: transparent;
    }
    .time{
      position: absolute;
      left: .3rem;
      bottom: .2rem;
      font-size: .24rem;
    }
  }
`

export const Abort = styled.div`
  padding: .30rem;
  font-size: .28rem;
  line-height: .40rem;
  color: #333;
`

export const Comment = styled.div`
  display: flex;
  position: fixed;
  left: .3rem;
  bottom: .3rem;
  right: .3rem;
  line-height: .3rem;
  i{
    font-size: .6rem;
    margin-top: .13rem;
  }
  input{
    flex: 1;
    border: .01rem solid #ccc;
    line-height: .6rem;
    margin: 0 .2rem;
    border-radius: .5rem;
    text-indent: .6rem;
  }
  .write{
    position: absolute;
    left: .4rem;
    font-size: .3rem;
  }
`
export const CommentList = styled.ul`
  overflow: hidden;
  li{
    padding: .2rem .30rem;
    border-bottom: 0.01rem solid #eee;
    display: flex;
    img{
      width: .6rem;
      height: .6rem;
      margin-right: .15rem;
      border-radius: 50%;
    }
    h3{
      overflow: hidden;
      font-size: .22rem;
      line-height: .28rem;
      font-weight: normal;
      color: #666;
      span{
        display: block;
        font-size: .18rem;
      }
    }
    .hidden{
      flex: 1;
      div{
        padding-top: .1rem;
        font-size: .24rem;
        line-height: .3rem;
        color: #333;
      }
    }
  }
`

export const CommentPop = styled.div`
  position: fixed;
  display: none;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  padding: 0 .3rem;
  flex-direction: column;
  justify-content: center;
  &.show {
    display: flex;
  }
  .cont {
    background: #fff;
    padding: .2rem;
    border-radius: .10rem;
    p{
      font-size: .3rem;
      color: #333;
      margin: .15rem 0;
    }
    textarea{
      width: calc(100%);
      border: 0.01rem solid #e6e6e6;
      padding: .2rem;
      box-sizing: border-box;
      border-radius: .1rem;
      text-indent: .4rem;
    }
    b{
      float: right;
      padding: 0 .36rem;
      color: #fff;
      line-height: .4rem;
      font-weight: normal;
      background: #c29c5d;
      border-radius: .1rem;
      margin: .2rem 0 0;
      font-size: .24rem;
    }
    .write{
      position: absolute;
      left: .68rem;
      margin-top: .17rem;
      font-size: .3rem;
    }
  }
`

export const Catalog = styled.ul`
  overflow: hidden;
  padding: .2rem 0;
`

export const CatalogItem = styled.li`
  position: relative;
  padding-left: .7rem;
  line-height: .80rem;
  border-bottom: 0.01rem solid #e6e6e6;
  .title{
    color: #333;
    font-weight: bold;
    padding-right: .3rem;
    span{
      color: #ccc;
      margin-right: .2rem;
    }
    i{
      float: right;
      font-size: .40rem;
      color: #ccc;
    }
  }
  &.atthis:after{
    background: #c29c5d;
  }
  &:after{
    content: '';
    position: absolute;
    left: .2rem;
    top: .3rem;
    background: #ccc;
    border-radius: 50%;
    width: .20rem;
    height: .20rem;
  }
  
  ul{
    display: none;
    opacity: 0;
    transtion: all .5s;
    &.show{
      display: block;
      opacity: 1;
    }
    margin-left: -.70rem;
    padding-bottom: .2rem;
    li{
      border-bottom: 0;
      padding: 0 0 0 .7rem;
      span{
        margin-right: .2rem;
      }
      &.atthis{
        color: #c29c5d;
      }
      &:before{
        content: '';
        position: absolute;
        left: .30rem;
        top: -.3rem;
        border-radius: 50%;
        width: 0rem;
        height: .6rem;
        border-left: .01rem dashed #ccc;
      }
      &.atthis:before{
        border-color: #c29c5d;
      } 
    }
  }
`

const bg_sm = require('../../assets/bg_tc.png')
export const PopUp = styled.div`
  position: fixed;
  display: none;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 11;
  &.show {
    display: block;
  }
  .content {
    width: 4.5rem;
    height: 6.33rem;
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -4rem 0 0 -2.25rem;
    background: transparent url(${bg_sm}) no-repeat left top;
    background-size: 100% auto;
    z-index: 12;
    text-align: center;
    h2 {
      font-size: 0.3rem;
      color: #c29c5d;
      padding-top: 1.6rem;
      font-weight: normal;
      line-height: .5rem;
    }
    p {
      font-size: 0.24rem;
      line-height: 0.48rem;
      color: #fff;
      padding: 0 .3rem;
    }
    b {
      font-size: 0.3rem;
      color: #333;
      font-weight: normal;
      position: absolute;
      bottom: .65rem;
      left:0;
      text-align: center;
      width: 100%;
    }
    i {
      font-size: 0.6rem;
      color: #fff;
      position: absolute;
      left: 50%;
      margin-left: -0.7rem;
      top: 7rem;
      background: #303030;
      border-radius: 50%;
      padding: .4rem;
    }
  }
`;